/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package CustomerGUI;

import LocalDB.Purchase;
import supermarket.*;

/**
 *
 * @author Panagis
 */
public class CustMainPanel extends javax.swing.JPanel {

    /**
     * Creates new form CustMainPanel
     */
    private final SuperMarketParentFrame frame;

    public CustMainPanel(SuperMarketParentFrame frame) {
        initComponents();
        this.frame = frame;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton5 = new javax.swing.JButton();
        BuyProducts = new javax.swing.JPanel();
        PurchaseButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        EditProfileButton1 = new javax.swing.JButton();
        ChecksjButton = new javax.swing.JButton();
        ChangePasswordjButton = new javax.swing.JButton();

        jButton5.setText("Επιστροφή");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        BuyProducts.setBorder(javax.swing.BorderFactory.createTitledBorder("Αγορά"));

        PurchaseButton.setText("Πραγματοποίηση αγορών");
        PurchaseButton.setMaximumSize(new java.awt.Dimension(199, 25));
        PurchaseButton.setMinimumSize(new java.awt.Dimension(199, 25));
        PurchaseButton.setPreferredSize(new java.awt.Dimension(199, 25));
        PurchaseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                PurchaseButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout BuyProductsLayout = new javax.swing.GroupLayout(BuyProducts);
        BuyProducts.setLayout(BuyProductsLayout);
        BuyProductsLayout.setHorizontalGroup(
            BuyProductsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(BuyProductsLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(PurchaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
                .addContainerGap())
        );
        BuyProductsLayout.setVerticalGroup(
            BuyProductsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(BuyProductsLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(PurchaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Διαχείριση Προφίλ"));

        EditProfileButton1.setText("Επεξεργασία προφίλ");
        EditProfileButton1.setMaximumSize(new java.awt.Dimension(199, 25));
        EditProfileButton1.setMinimumSize(new java.awt.Dimension(199, 25));
        EditProfileButton1.setPreferredSize(new java.awt.Dimension(199, 25));
        EditProfileButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditProfileButton1ActionPerformed(evt);
            }
        });

        ChecksjButton.setText("Επιταγές");
        ChecksjButton.setMaximumSize(new java.awt.Dimension(199, 25));
        ChecksjButton.setMinimumSize(new java.awt.Dimension(199, 25));
        ChecksjButton.setPreferredSize(new java.awt.Dimension(199, 25));
        ChecksjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ChecksjButtonActionPerformed(evt);
            }
        });

        ChangePasswordjButton.setText("Αλλαγή κωδικού");
        ChangePasswordjButton.setMaximumSize(new java.awt.Dimension(199, 25));
        ChangePasswordjButton.setMinimumSize(new java.awt.Dimension(199, 25));
        ChangePasswordjButton.setPreferredSize(new java.awt.Dimension(199, 25));
        ChangePasswordjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ChangePasswordjButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(EditProfileButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ChangePasswordjButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ChecksjButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addComponent(EditProfileButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ChangePasswordjButton, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ChecksjButton, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(6, 6, 6))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(jButton5))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(88, 88, 88)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(BuyProducts, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(88, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(BuyProducts, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(90, 90, 90)
                .addComponent(jButton5)
                .addGap(49, 49, 49))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        frame.pnl = new LoginPanel(this.frame);
        frame.addPanelInMain();
    }//GEN-LAST:event_jButton5ActionPerformed

    private void EditProfileButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditProfileButton1ActionPerformed
        // TODO add your handling code here:
        frame.pnl = new EditProfileJPanel(this.frame);
        frame.addPanelInMain();
    }//GEN-LAST:event_EditProfileButton1ActionPerformed

    private void ChecksjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ChecksjButtonActionPerformed
        frame.pnl = new ChecksJPanel(this.frame);
        frame.addPanelInMain();
    }//GEN-LAST:event_ChecksjButtonActionPerformed

    private void ChangePasswordjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ChangePasswordjButtonActionPerformed
        // TODO add your handling code here:
        frame.pnl = new ChangePasswordJPanel(this.frame);
        frame.addPanelInMain();
    }//GEN-LAST:event_ChangePasswordjButtonActionPerformed

    private void PurchaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PurchaseButtonActionPerformed
        // TODO add your handling code here:
        frame.pnl = new PurchaseJPanel(this.frame);
        frame.addPanelInMain();
    }//GEN-LAST:event_PurchaseButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel BuyProducts;
    private javax.swing.JButton ChangePasswordjButton;
    private javax.swing.JButton ChecksjButton;
    private javax.swing.JButton EditProfileButton1;
    private javax.swing.JButton PurchaseButton;
    private javax.swing.JButton jButton5;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration//GEN-END:variables
}
